package com.example.lockdemo.controller;

import com.example.lockdemo.config.MyLock;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author GuoAo
 * @className LockController
 * @date 2025/4/24
 * @description TODO
 */
@RestController
@RequestMapping("/lock")
public class LockController {

    @GetMapping("/test")
    @MyLock(key ="#id",waitTime = 1)
    public String test(String id) throws InterruptedException {
        Thread.sleep(500);
        return "test";
    }
}
